#include <iostream>
#include <string>
#include <unordered_map>
#include "Log.hpp"
using namespace std;
class Translation
{
public:
    Translation()
    {
    }
    string Execute(string &buf)
    {
        string lower_buf = buf;
        for (char &c : lower_buf)
            c = tolower(c);

        auto it = _dictionary.find(lower_buf); // 使用小写版本查询
        if (it == _dictionary.end())
        {
            return "字典不存在该单词";
        }
        return it->second; // 直接返回迭代器值避免二次查找
    }
    ~Translation()
    {
    }

private:
    unordered_map<string, string> _dictionary = {{"hello", "你好"},
                                                 {"world", "世界"},
                                                 {"python", "蟒蛇"},
                                                 {"c++", "C加加"},
                                                 {"server", "服务器"},
                                                 {"client", "客户端"},
                                                 {"good", "好"},
                                                 {"morning", "早晨"},
                                                 {"thank", "谢谢"},
                                                 {"you", "你"}};
};